|
|
While experimenting with the function rand () to simulate a random
distribution of trees, (moving object at a random distance from origin and
then doing it orbit on the y-axis, when I found this.
I've noticed a pattern when attempting to distribute objects on a square
grid. But why this circular distribution?
Does anyone know why there are 7 arms and not 5 or 13 or something more
random?
#include "colors.inc"
#include "math.inc"
camera {location <0,20,-30>
look_at <0,0,0>
}
light_source {<50,100,-10> colour White}
plane {y,0
texture {
pigment {checker colour White colour Orange}
}
}
#declare Tree =
union {cylinder {<0,0,0>,<0,1,0>,.1 pigment {Red}}
sphere {<0,1,0>.4 pigment {Green}}
}
#local Num_Tree = 0 ;
#while (Num_Tree<1000)
#local rnd_tree = seed (Num_Tree);
#if (rand (rnd_tree)<.95 )
object {Tree
translate <50*rand(rnd_tree),0,0>
rotate y*360*rand(rnd_tree)
}
#end
#local Num_Tree = Num_Tree +1 ;
#end
pd. I found it while editing the code to upload the image. The key is in the
use of the same rand value to control the density of generating objects. But
interesting anyway.
pd2 google searchs results: "the seven arms of Shiva", "the seven arms of
the Menorah", "an Octopus with only seven arms"...
B. Gimeno
Post a reply to this message
Attachments:
Download 'random_trees.jpg' (98 KB)
Preview of image 'random_trees.jpg'
|
|